import * as TYPES from '@/store/action-types.js'
import {queryUserInfo} from "@/api/index.js";
export const baseAction = {
    async queryUserInfoAsync(){
        let info = null;
        try{
            const {code,data} = await queryUserInfo()
            if(code === '200'){
                info = data
            }
        }catch (e) {
            info = null
        }

        return {
            type: TYPES.BASE_INFO,
            info
        }
    },

    clearUserInfo(){
        return {
            type: TYPES.BASE_INFO,
            info: null
        }
    }
}